__author__ = 'East'

import time

user, passwd = 'alex', '123'
def auth(auth_type):
    def out_wrapper(func):
        def wrapper(*args, **kwargs):
            username = input('Username: ').strip()
            password = input('Password: ').strip()
            if user == username and password == passwd:
                print('User pass')
                return func(*args, **kwargs)
            else:
                exit('User error')
        return wrapper
    return out_wrapper

def index():
    print('welecom to inedx page')
    return 'from home'

@auth(auth_type='local')
def home():
    print('welcome to home page')

@auth(auth_type='ldap')
def bbs():
    print('weclome to bbs page')

index()
print(home())
bbs()